package tt.dz.egobus.servicemanager.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import tt.dz.egobus.servicemanager.vo.SimpleTestVo;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by anson-worker on 17-2-28.
 */
@Controller
@RequestMapping("/test")
public class TestController {

    private static final Logger logger = LoggerFactory.getLogger(TestController.class);


    @RequestMapping(value = "json")
    @ResponseBody
    public List<SimpleTestVo> ajaxList(){
        List<SimpleTestVo> list = new ArrayList<SimpleTestVo>();
        SimpleTestVo vo = new SimpleTestVo();
        vo.setId("123432");
        vo.setName("anson");
        list.add(vo);
        return list;
    }

    @RequestMapping(value = "test")
    public String test(){
        return "test";
    }

    @RequestMapping(value = "ioexception")
    public String ioexception() throws IOException{
        throw  new IOException("1111");
    }
}
